
from util.Logger import Logger
from services.DeepSeekService import DeepSeekService
from services.ZhipuService import ZhipuService
from services.QwenService import QwenService
from config import Config


class AIServiceFactory:
    @staticmethod
    def create_service(config:Config,loop=None):
        logger=Logger(__name__)
        provider=config.get_current_provider()
        logger.debug(f"创建AI服务，服务商为：{provider}")
        if provider=="deepseek":
            logger.info("初始化DeepSeek完成")
            return DeepSeekService(config.get_api_key("deepseek"),loop)
        elif provider=="zhipu":
            logger.info("初始化Zhipu完成")
            return ZhipuService(config.get_api_key("zhipu"),loop)
        elif provider=="qwen":
            logger.info("初始化Zhipu完成")
            return QwenService(config.get_api_key("qwen"),loop)